---
name: useBooleanKnob
menu: Knobs
route: /knobs/boolean
---

import { useState } from "react";
import { Playground } from "docz";
import { Inspector, useBooleanKnob } from "../../src/lib";

### useBooleanKnob(label, value)

Shows a checkbox in the inspector panel. Returns the value and a method to change the value.

- `label` - A label for the knob
- `value` - A boolean value as initial value

#### Usage

```javascript
import { useBooleanKnob } from "retoggle";
```

<Playground>
{() => {
    const [value, setValue] = useBooleanKnob("Boolean", true);

    return (
        <React.Fragment>
            <Inspector usePortal={false} />
            {value.toString()}
        </React.Fragment>
    )

}}

</Playground>
